home *** CD-ROM | disk | FTP | other *** search
/ The Trig Explorer / The Trig Explorer.iso / mac / Explorer / START.dxr / 00171_Volume Slide and Control.ls < prev    next >
Encoding:
Text File  |  1998-07-22  |  1.2 KB  |  41 lines

  1. on beginSprite me
  2.   set the cursor of sprite the spriteNum of me to [member "Hand", member "Hand Mask"]
  3.   set tVolume to the soundLevel
  4.   set x to 182 + (tVolume * 30)
  5.   set the locH of sprite the spriteNum of me to x
  6. end
  7.  
  8. on endSprite me
  9.   set the cursor of sprite the spriteNum of me to 0
  10. end
  11.  
  12. on mouseUp me
  13.   set the cursor of sprite the spriteNum of me to [member "Hand", member "Hand Mask"]
  14. end
  15.  
  16. on mouseDown me
  17.   set the cursor of sprite the spriteNum of me to [member "Closed Hand", member "Closed Hand Mask"]
  18.   puppetSound("Volume Sound")
  19.   repeat while the stillDown
  20.     if (the mouseH >= 182) and (the mouseH <= 392) then
  21.       set the locH of sprite the spriteNum of me to the mouseH
  22.       if the machineType = 256 then
  23.         set dx to the mouseH - 182
  24.         set dx to dx / 30
  25.         set the soundLevel to dx
  26.       else
  27.         set dx to (the mouseH - 182) * 0.80000000000000004
  28.         set the volume of sound 1 to dx
  29.         set the volume of sound 2 to dx
  30.         set the volume of sound 3 to dx
  31.         set dx to the mouseH - 182
  32.         set dx to dx / 30
  33.         set the soundLevel to dx
  34.       end if
  35.       updateStage()
  36.     end if
  37.   end repeat
  38.   sound stop 2
  39.   sound stop 1
  40. end
  41.